package edu.yngsxy.wkstudy.core.sys.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import edu.yngsxy.wkstudy.core.model.entity.WkBaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import jakarta.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
/**
 * <p>
 * 学习记录表
 * </p>
 *
 * @author group 2
 * @since 2025-09-09
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName("learningrecord")
@Schema(description = "学习记录表")
public class Learningrecord extends WkBaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 学习记录ID
     */
    @TableField(value = "record_id")
    @Schema(title = "学习记录ID", description = "学习记录ID", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotNull(message = "学习记录ID不能为空")
    private Integer recordId;

    /**
     * 学生ID（外键，关联User）
     */
    @TableField("user_id")
    @Schema(title = "学生ID（外键，关联User）", description = "学生ID（外键，关联User）", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    private Integer userId;

    /**
     * 章节ID（外键，关联Chapter）
     */
    @TableField("chapter_id")
    @Schema(title = "章节ID（外键，关联Chapter）", description = "章节ID（外键，关联Chapter）", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    private Integer chapterId;

    /**
     * 学习时间
     */
    @TableField("learn_time")
    @Schema(title = "学习时间", description = "学习时间", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotNull(message = "学习时间不能为空")
    private LocalDateTime learnTime;

    /**
     * 学习进度（0-100%）
     */
    @TableField("progress")
    @Schema(title = "学习进度（0-100%）", description = "学习进度（0-100%）", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    private BigDecimal progress;
}
